package com.bs.dao.impl;

import java.util.List;

import org.springframework.orm.ibatis.support.SqlMapClientDaoSupport;

import com.bs.bean.Unit;
import com.bs.dao.UnitDAO;

public class UnitDAOImpl extends SqlMapClientDaoSupport implements UnitDAO {

	@Override
	public int delete(Unit unit) {
		return this.getSqlMapClientTemplate().delete("unit.delete",unit);
	}

	
	@Override
	public int batchDelete(String ids) {
		return this.getSqlMapClientTemplate().delete("unit.batchDelete",ids);
	}


	@Override
	public void save(Unit unit){
		this.getSqlMapClientTemplate().insert("unit.save", unit);
	}

	@SuppressWarnings("unchecked")
	@Override
	public List<Unit> query(Unit unit) {
		return this.getSqlMapClientTemplate().queryForList("unit.query",unit);
	}

	
}
